import { defineStore } from 'pinia'

export const useRoomStore = defineStore('rooms', {
  state: () => ({
    rooms: [],
    filteredRooms: []
  }),
  
  actions: {
    async fetchRooms() {
      const response = await this.$api.get('/rooms')
      this.rooms = response
    },
    
    async filterRooms(params) {
      const response = await this.$api.post('/rooms/filter', params)
      this.filteredRooms = response
    }
  }
})